Auto merge of #5228 - phil-opp:target-spec, r=alexcrichton
authorbors <bors@rust-lang.org>
Mon, 26 Mar 2018 13:00:26 +0000 (13:00 +0000)
committerbors <bors@rust-lang.org>
Mon, 26 Mar 2018 13:00:26 +0000 (13:00 +0000)
commit715fc78caa832223a3404925a829e18c7832703a
treea9f7c908b1bc4a21841187666850db233bdebe21
parentcff944b58ab3e9d3a1c68bf5b5601e27440692a6
parent6ab70197e599a6c52e00455938de67b7715a1fa8
Auto merge of #5228 - phil-opp:target-spec, r=alexcrichton

Add support for absolute target.json paths

Builds upon https://github.com/rust-lang/rust/pull/49019 with the goal to provide a solution to https://github.com/rust-lang/cargo/issues/4905.

This PR does two things:

~~1. It appends a hash of the target path to the target folder name if a `*.json` path is passed as `--target`, like it's done in https://github.com/rust-lang/rust/pull/49019. This helps differentiating targets with the same JSON file name and avoids sysroot clashes in `xargo`.~~ See https://github.com/rust-lang/cargo/pull/5228#discussion_r176827531
2. It canonicalizes the passed target path (if it's a `*.json` path), so that the path stays valid when building dependencies and setting the `RUST_TARGET_PATH` environment variable is no longer necessary.
tests/testsuite/main.rs